package brianchen;

import com.addedstuff.Brianmodbase;

import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import cpw.mods.fml.common.registry.GameRegistry;

public class util 
{
	public static void recipes()
	{
		ItemStack diamond = new ItemStack (Item.diamond, 64);
		ItemStack dirt = new ItemStack (Block.dirt);
		ItemStack golden_apple= new ItemStack (Item.appleGold, 64);
		ItemStack sand= new ItemStack (Block.sand);
		ItemStack arrow= new ItemStack (Item.arrow, 64);
		ItemStack stick= new ItemStack (Item.stick);
		ItemStack expbottle= new ItemStack (Item.expBottle,64);
		ItemStack cobblestone= new ItemStack (Block.cobblestone);
		ItemStack bow= new ItemStack (Item.bow);
		ItemStack Diamond= new ItemStack (Item.diamond);
		ItemStack coal= new ItemStack (Block.oreCoal);
		ItemStack Goldenapple= new ItemStack (Item.appleGold);
		ItemStack Endereye= new ItemStack (Item.eyeOfEnder);
		ItemStack goldenApple= new ItemStack (Item.appleGold);
		ItemStack ladder= new ItemStack (Block.ladder);
		ItemStack planks= new ItemStack (Block.planks);
		ItemStack aArrow= new ItemStack (Item.arrow );
		ItemStack Obsidian_Sword= new ItemStack (Brianmodbase.Obsidian_Sword);
		ItemStack Torch= new ItemStack (Block.torchWood);
		ItemStack Piston= new ItemStack (Block.pistonStickyBase);
		ItemStack Lever= new ItemStack (Block.lever);
		ItemStack InfinityBow= new ItemStack (Brianmodbase.Infinity_Bow);
		ItemStack Thunders= new ItemStack (Brianmodbase.Lightning_Sword);
		ItemStack Excaliber= new ItemStack (Brianmodbase.Excaliber);
		ItemStack Wood= new ItemStack (Block.wood );
		ItemStack Firewand= new ItemStack (Brianmodbase.Wandoff);
		ItemStack Revolver= new ItemStack (Brianmodbase.Revolver);
		ItemStack Coal= new ItemStack (Item.coal);
		ItemStack Flywand = new ItemStack (Brianmodbase.Flywand);
		ItemStack thorhammer = new ItemStack (Brianmodbase.thorhammer);
		ItemStack Quickhouse = new ItemStack (Brianmodbase.Quickhouse);
		ItemStack ObH = new ItemStack (Brianmodbase.ObH);
		ItemStack ObC = new ItemStack (Brianmodbase.ObC);
		ItemStack ObL = new ItemStack (Brianmodbase.ObL);
		ItemStack ObB = new ItemStack (Brianmodbase.ObB);
		ItemStack Obsidian = new ItemStack (Block.obsidian);
	    GameRegistry.addShapelessRecipe(diamond, dirt);
	    GameRegistry.addShapelessRecipe(golden_apple, sand);
	    GameRegistry.addShapelessRecipe(arrow, stick);
	    GameRegistry.addShapelessRecipe(Torch, cobblestone);
	    GameRegistry.addShapelessRecipe(Piston, Diamond);
	    GameRegistry.addShapelessRecipe(Endereye, goldenApple);
	    GameRegistry.addShapedRecipe(Obsidian_Sword," y ", " y ", " x ", 'x', stick,'y',Obsidian);
	   GameRegistry.addShapedRecipe(InfinityBow, "y  " , " y " , "y  " ,'y', dirt);
	   GameRegistry.addShapedRecipe(Thunders, " y " , " y " , " x " , 'x' , stick, 'y' ,sand);
	    GameRegistry.addShapedRecipe(Excaliber, " y " , " y " , " x " , 'x' , stick, 'y' ,Wood);
	    GameRegistry.addShapedRecipe(Revolver, "  y" , " y " , "y  " , 'y', dirt);
	    GameRegistry.addShapedRecipe(Firewand, " y " , " y " , " x " , 'x', stick,'y',coal);
	    GameRegistry.addShapedRecipe(Flywand, " y " , " y " , " y " , 'y', stick);
	    GameRegistry.addShapedRecipe(thorhammer, "xxx" , "xxx" , " y " , 'x', Obsidian, 'y', stick);
	    GameRegistry.addShapedRecipe(Quickhouse, "  x" , " y " , "y  " , 'y', stick, 'x', dirt);
	    GameRegistry.addShapedRecipe(ObC, "x x" , "xxx" , "xxx" , 'x',Obsidian);
	    GameRegistry.addShapedRecipe(ObH, "xxx" , "x x" , "   " , 'x',Obsidian);
	    GameRegistry.addShapedRecipe(ObL, "xxx" , "x x" , "x x" , 'x',Obsidian);
	    GameRegistry.addShapedRecipe(ObB, "   " , "x x" , "x x" , 'x',Obsidian);
	    Excaliber.addEnchantment(Enchantment.knockback, 30);
	    InfinityBow.addEnchantment(Enchantment.power, 10);
	    InfinityBow.addEnchantment(Enchantment.infinity, 1);
	    InfinityBow.addEnchantment(Enchantment.fireAspect, 10);
	    InfinityBow.addEnchantment(Enchantment.punch, 30);
	    thorhammer.addEnchantment(Enchantment.fireAspect, 30);
	    thorhammer.addEnchantment(Enchantment.sharpness, 30);
	    thorhammer.addEnchantment(Enchantment.smite, 30);
	    thorhammer.addEnchantment(Enchantment.unbreaking, 30);
	    ObH.addEnchantment(Enchantment.thorns, 100);
	    ObC.addEnchantment(Enchantment.thorns, 100);
	    ObL.addEnchantment(Enchantment.thorns, 100);
	    ObB.addEnchantment(Enchantment.thorns, 100);
	    
	}
	public static Vec3 placeInFrontOfEntity(Entity _entity, float meters)
	{
	    Vec3 ret = Vec3.createVectorHelper(0,0,0);
	    ret.xCoord = _entity.posX;
	    ret.yCoord = _entity.posY;
	    ret.zCoord = _entity.posZ;
	    float yaw = _entity.rotationYaw - 90;
	    ret.xCoord -= ((double)(MathHelper.cos(yaw/ 180.0F * (float)Math.PI))) * meters;
	    ret.zCoord -= ((double)(MathHelper.sin(yaw/ 180.0F * (float)Math.PI))) * meters;
	    return ret;
	}
	public static Vec3 placeInRandomDirection(int x, int y, int z, float meters)
	{
	    Vec3 ret = Vec3.createVectorHelper(0,0,0);
	    ret.xCoord = x;
	    ret.yCoord = y;
	    ret.zCoord = z;
	    float yaw = (float)Math.random() * 360;
	    ret.xCoord -= ((double)(MathHelper.cos(yaw/ 180.0F * (float)Math.PI))) * meters;
	    ret.zCoord -= ((double)(MathHelper.sin(yaw/ 180.0F * (float)Math.PI))) * meters;
	    return ret;
	}
}
